//Author: David Lo
//Date: 11/16/12
//References: Collide_Coins.js
//Description: Collisions with coins will destroy coin object on contact,
// increments counter and updates Player Score within PlayerPrefs

static var Counter : int = 0;

function OnTriggerEnter(myCollider : Collider)
{
    if( collider.gameObject.name == "Coin" )
    {
    	//Increment score on colliding
    	Counter++;
    	PlayerPrefs.SetInt("Player Score", Counter);
    	
    	//Destroys the coin object
        Destroy(collider.gameObject);
    }
}

